import {createRouter, createWebHashHistory, createWebHistory} from 'vue-router'

export const routes = [{
    path: '/',
    name: '',
    component: () => import('@/layouts/BasicLayout.vue'),
    redirect: '/home',
    children: [{
        path: '/home',
        component: () => import('@/views/home/Home.vue')
    }, {
        path: '/home/:category',
        props: true,
        component: () => import('@/views/process/DataPage.vue')
    }]
}, {
    path: '/view',
    name: 'view',
    redirect: '/view',
    children: [{
        path: '/view/process/:category/:processId/:masterId',
        props(route) {
            return {
                category: route.params.category,
                processId: route.params.processId,
                masterId: route.params.masterId
            }
        },
        component: () => import('@/views/open/ProcessAndResume.vue')
    }]
}];

const router = createRouter({
    history: createWebHashHistory(import.meta.env.BASE_URL),
    routes
})

export default router